//
//  CustomButtonFontAndBackgroundView.swift
//  SwiftUIButton
//
//  Created by 李煜 on 2024/7/30.
//

import SwiftUI

struct CustomButtonFontAndBackgroundView: View {
    var body: some View {
        Button(action: {}, label: {
            Text("Hello World")
            //添加内边距
                .padding()
            //背景色
                .background { Color.purple }
            //文字颜色
                .foregroundColor(.white)
            // 字体
                .font(.title)
        })
    }
}

#Preview {
    CustomButtonFontAndBackgroundView()
}
